<?php
/**
 * @version		2.0.1 | $Id: default.php 93 2009-08-28 10:56:02Z mwi.nor $
 */

// no direct access
defined('_JEXEC') or die('Restricted access'); ?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr>
            <th width="10" align="center">
    			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_NAME' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_DEFAULT' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_PUBLISHED' ); ?>
            </th>
            <!--
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_LOGO' ); ?>
            </th>
			-->
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_REMARKS' ); ?>
            </th>
            <!--
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_PLAYERS' ); ?>
            </th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_TEAMS' ); ?>
            </th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_POINTS' ); ?>
            </th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_LINE' ); ?>
            </th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_MATCHTYPE' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_USE_PLAYERSTATS' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_USE_SETS' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_USE_TEAMS' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_USE_VENUES' ); ?>
            </th>
			<th width="20" align="center">
                <?php echo JText::_( 'MD_EVENT_RLPOINTS' ); ?>
            </th>
			<th width="10" align="center">
                <?php echo JText::_( 'MD_EVENT_USE_DRAWS' ); ?>
            </th>
		    -->
        </tr>            
    </thead>
    <?php
    $imgpath = 'components/com_matchdart/images/';
    $k = 0;
    for ($i=0, $n=count( $this->items ); $i < $n; $i++)
    {
        $row =& $this->items[$i];
        $checked    = JHTML::_( 'grid.id', $i, $row->EventID );
        $link = JRoute::_( 'index.php?option=com_matchdart&controller=events&task=edit&cid[]='. $row->EventID );
        ?>
        <tr class="<?php echo "row$k"; ?>">
            <td align="center">
  				  <?php echo $checked; ?>
			</td>
            <td align="center">
            	<a href="<?php echo $link ?>"><?php echo $row->EventName; ?></a>
            </td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','defaultEvent')" title="<?php echo ( $row->EventDefault ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="images/<?php echo ( $row->EventDefault == 1 ? 'apply_f2.png' :  'apply.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventDefault ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
            </td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','togglePublish')" title="<?php echo ( $row->EventPublish ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="images/<?php echo ( $row->EventDefault == 1 ? 'disabled.png' : ( $row->EventPublish == 1  ? 'publish_g.png' : 'publish_r.png' ));?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventPublish ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
            </td>
            <!--
            <td align="center">
  				  <?php echo $row->EventLogo; ?>
			</td>
            -->
            <td align="center">
  				  <?php echo $row->EventRemarks; ?>
			</td>
			<!--
            <td align="center">
  				  <?php echo $row->EventPlayers; ?>
			</td>
            <td align="center">
  				  <?php echo $row->EventTeams; ?>
			</td>
            <td align="center">
  				  <?php echo $row->EventPointsWin.' / '.$row->EventPointsDraw.' / '.$row->EventPointsLose; ?>
			</td>
            <td align="center">
  				  <?php echo $row->EventLine; ?>
			</td>
            <td align="center">
  				  <?php echo $row->EventMatchType; ?>
			</td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggleUsePlayerStats')" title="<?php echo ( $row->EventUsePlayerStats ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="<?php echo $imgpath.( $row->EventUsePlayerStats == 1  ? 'yes.png' : 'no.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventUsePlayerStats ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
			</td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggleUseSets')" title="<?php echo ( $row->EventUseSets ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="<?php echo  $imgpath.( $row->EventUseSets == 1  ? 'yes.png' : 'no.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventUseSets ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
			</td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggleUseTeams')" title="<?php echo ( $row->EventUseTeams ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="<?php echo  $imgpath.( $row->EventUseTeams == 1  ? 'yes.png' : 'no.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventUseTeams ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
			</td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggleUseVenues')" title="<?php echo ( $row->EventUseVenues ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="<?php echo  $imgpath.( $row->EventUseVenues == 1  ? 'yes.png' : 'no.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventUseVenues ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
			</td>
            <td align="center">
  				  <?php echo $row->EventRLPointsWin.' / '.$row->EventRLPointsDraw.' / '.$row->EventRLPointsLose; ?>
			</td>
            <td align="center">
				<a href="javascript:void(0);" onclick="return listItemTask('cb<?php echo $i;?>','toggleUseDraws')" title="<?php echo ( $row->EventUseDraws ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>">
				<img src="<?php echo  $imgpath.( $row->EventUseDraws == 1  ? 'yes.png' : 'no.png' );?>" width="16" height="16" border="0" alt="<?php echo ( $row->EventUseDraws ) ? JText::_( 'Yes' ) : JText::_( 'No' );?>" /></a>
			</td>
        	-->
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    <tfoot>
		<tr>
			<td colspan="17">
				<?php echo $this->pagination->getListFooter(); ?>
			</td>
		</tr>
	</tfoot>
    </table>
</div>

<input type="hidden" name="option" value="com_matchdart" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="events" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>